name: bun-types
on:
  push:
    paths:
      - "packages/bun-types/**"
    branches: [main]
  pull_request:
    paths:
      - "packages/bun-types/**"

jobs:
  tests:
    name: type-tests
    runs-on: ubuntu-latest
    defaults:
      run:
        working-directory: packages/bun-types

    steps:
      - name: Checkout repo
        uses: actions/checkout@v4

      - name: Install bun
        uses: oven-sh/setup-bun@v1
        with:
          bun-version: canary

      - name: Install node
        uses: actions/setup-node@v3
        with:
          node-version: latest

      - name: Install dependencies
        run: |
          bun install

      - name: Generate package
        run: bun run build

      - name: Tests
        run: bun run test
